package com.itheima.mapper;

import com.itheima.pojo.OrderSetting;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.Date;
import java.util.List;
import java.util.Map;

@Mapper
public interface OrderSettingMapper {

    @Update("update t_ordersetting set number = #{number} where orderDate = #{orderDate}")
    void editNumberByOrderDate(OrderSetting orderSetting);

    @Select("select * from t_ordersetting where  orderDate between  #{begin} and #{end}")
    List<OrderSetting> getOrderSettingByMonth(Map map);

    @Select("select * from t_ordersetting where orderDate = #{orderDate}")
    long findCountByOrderDate(Date orderDate);
@Select("insert into t_ordersetting(orderDate, number, reservations) values (#{orderDate},#{number},#{reservations})")
    void add(OrderSetting orderSetting);
}
